﻿using Entitas;
using System.Linq;
class EnemyRoamingTimerSystem : IExecuteSystem
{
    EnemyContext enemyContext;
    public EnemyRoamingTimerSystem(Contexts contexts)
    {
        enemyContext = contexts.enemy;
    }
    public void Execute()
    {
        foreach (var e in enemyContext.GetEntities().Where(x => x.isRoaming==true&& x.hasRoamingTimer&& x.roamingTimer.value >= 0))
        {
           
            e.ReplaceRoamingTimer(e.roamingTimer.value - .01f);       
        }
    }
}

